home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1991-04-05 | 6.5 KB | 239 lines | [ TEXT/PJMM]
{ This file has been processed by The THINK Pascal Source Converter, v1.1. } {} { Connections.p} { Pascal Interface to the Connection Manager} { } { Copyright © Apple Computer, Inc. 1988-90} { All rights reserved} {} {$IFC UNDEFINED UsingIncludes} {$SETC UsingIncludes := 0} {$ENDC} unit Connections; interface uses Types, OSUtils, AppleTalk, Memory, Script, Packages, Dialogs, CTBUtilities; const { current Connection Manager version } curCMVersion = 2; { current Connection Manager Environment Record version } curConnEnvRecVers = 0; { error codes } cmGenericError = -1; cmNoErr = 0; cmRejected = 1; cmFailed = 2; cmTimeOut = 3; cmNotOpen = 4; cmNotClosed = 5; cmNoRequestPending = 6; cmNotSupported = 7; cmNoTools = 8; cmUserCancel = 9; cmUnknownError = 11; { CMRecFlags / CMChannel} { Low word of CMRecFlags is same as CMChannel } cmData = $00000001; cmCntl = $00000002; cmAttn = $00000004; cmDataNoTimeout = $00000010; cmCntlNoTimeout = $00000020; cmAttnNoTimeout = $00000040; cmDataClean = $00000100; cmCntlClean = $00000200; cmAttnClean = $00000400; { only for CMRecFlags (not CMChannel) below this point } cmNoMenus = $00010000; cmQuiet = $00020000; { CMStatFlags} cmStatusOpening = $00000001; cmStatusOpen = $00000002; cmStatusClosing = $00000004; cmStatusDataAvail = $00000008; cmStatusCntlAvail = $00000010; cmStatusAttnAvail = $00000020; cmStatusDRPend = $00000040; {data read pending} cmStatusDWPend = $00000080; {data write pending} cmStatusCRPend = $00000100; {cntl read pending} cmStatusCWPend = $00000200; {cntl write pending} cmStatusARPend = $00000400; {attn read pending} cmStatusAWPend = $00000800; {attn write pending} cmStatusBreakPend = $00001000; cmStatusListenPend = $00002000; cmStatusIncomingCallPresent = $00004000; cmStatusReserved0 = $00008000; { CMSearchFlags} cmSearchSevenBit = $0001; { CMFlags} cmFlagsEOM = $0001; type CMErr = OSErr; CMBufFields = (cmDataIn, cmDataOut, cmCntlIn, cmCntlOut, cmAttnIn, cmAttnOut, cmRsrvIn, cmRsrvOut); CMBuffers = array[CMBufFields] of Ptr; CMBufferSizes = array[CMBufFields] of LONGINT; CMStatFlags = LONGINT; CMRecFlags = LONGINT; CMChannel = INTEGER; CMSearchFlags = INTEGER; CMFlags = INTEGER; ConnEnvironRecPtr = ^ConnEnvironRec; ConnEnvironRec = record version: INTEGER; baudRate: LONGINT; dataBits: INTEGER; channels: CMChannel; swFlowControl: BOOLEAN; hwFlowControl: BOOLEAN; flags: CMFlags; end; ConnHandle = ^ConnPtr; ConnPtr = ^ConnRecord; ConnRecord = record procID: INTEGER; flags: CMRecFlags; errCode: CMErr; refCon: LONGINT; userData: LONGINT; defProc: ProcPtr; config: Ptr; oldConfig: Ptr; asyncEOM: LONGINT; reserved1: LONGINT; reserved2: LONGINT; cmPrivate: Ptr; bufferArray: CMBuffers; bufSizes: CMBufferSizes; mluField: LONGINT; asyncCount: CMBufferSizes; end; function InitCM: CMErr; function CMGetVersion (hConn: ConnHandle): Handle; function CMGetCMVersion: INTEGER; function CMNew (procID: INTEGER; flags: CMRecFlags; desiredSizes: CMBufferSizes; refCon: LONGINT; userData: LONGINT): ConnHandle; procedure CMDispose (hConn: ConnHandle); function CMListen (hConn: ConnHandle; async: BOOLEAN; completor: ProcPTr; timeout: LONGINT): CMErr; function CMAccept (hConn: ConnHandle; accept: BOOLEAN): CMErr; function CMOpen (hConn: ConnHandle; async: BOOLEAN; completor: ProcPtr; timeout: LONGINT): CMErr; function CMClose (hConn: ConnHandle; async: BOOLEAN; completor: ProcPtr; timeout: LONGINT; now: BOOLEAN): CMErr; function CMAbort (hConn: ConnHandle): CMErr; function CMStatus (hConn: ConnHandle; var sizes: CMBufferSizes; var flags: CMStatFlags): CMErr; procedure CMIdle (hConn: ConnHandle); procedure CMReset (hConn: ConnHandle); procedure CMBreak (hConn: ConnHandle; duration: LONGINT; async: BOOLEAN; completor: ProcPtr); function CMRead (hConn: ConnHandle; theBuffer: Ptr; var toRead: LONGINT; theChannel: CMChannel; async: BOOLEAN; completor: ProcPtr; timeout: LONGINT; var flags: CMFlags): CMErr; function CMWrite (hConn: ConnHandle; theBuffer: Ptr; var toWrite: LONGINT; theChannel: CMChannel; async: BOOLEAN; completor: ProcPtr; timeout: LONGINT; flags: CMFlags): CMErr; function CMIOKill (hConn: ConnHandle; which: INTEGER): CMErr; procedure CMActivate (hConn: ConnHandle; activate: BOOLEAN); procedure CMResume (hConn: ConnHandle; resume: BOOLEAN); function CMMenu (hConn: ConnHandle; menuID: INTEGER; item: INTEGER): BOOLEAN; function CMValidate (hConn: ConnHandle): BOOLEAN; procedure CMDefault (var theConfig: Ptr; procID: INTEGER; allocate: BOOLEAN); function CMSetupPreflight (procID: INTEGER; var magicCookie: LONGINT): Handle; procedure CMSetupSetup (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var magicCookie: LONGINT); function CMSetupFilter (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var theEvent: EventRecord; var theItem: INTEGER; var magicCookie: LONGINT): BOOLEAN; procedure CMSetupItem (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var theItem: INTEGER; var magicCookie: LONGINT); procedure CMSetupCleanup (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var magicCookie: LONGINT); procedure CMSetupPostflight (procID: INTEGER); function CMGetConfig (hConn: ConnHandle): Ptr; function CMSetConfig (hConn: ConnHandle; thePtr: Ptr): INTEGER; function CMIntlToEnglish (hConn: ConnHandle; inputPtr: Ptr; var outputPtr: Ptr; language: INTEGER): OSErr; function CMEnglishToIntl (hConn: ConnHandle; inputPtr: Ptr; var outputPtr: Ptr; language: INTEGER): OSErr; function CMAddSearch (hConn: ConnHandle; theString: Str255; flags: CMSearchFlags; callBack: ProcPtr): LONGINT; procedure CMRemoveSearch (hConn: ConnHandle; refnum: LONGINT); procedure CMClearSearch (hConn: ConnHandle); function CMGetConnEnvirons (hConn: ConnHandle; var theEnvirons: ConnEnvironRec): CMErr; function CMChoose (var hConn: ConnHandle; where: Point; idleProc: ProcPtr): INTEGER; procedure CMEvent (hConn: ConnHandle; theEvent: EventRecord); procedure CMGetToolName (procID: INTEGER; var name: Str255); function CMGetProcID (name: Str255): INTEGER; procedure CMSetRefCon (hConn: ConnHandle; refCon: LONGINT); function CMGetRefCon (hConn: ConnHandle): LONGINT; procedure CMSetUserData (hConn: ConnHandle; userData: LONGINT); function CMGetUserData (hConn: ConnHandle): LONGINT; {UsingConnections} implementation end.